Today, hashing functions are widely used in a variety of computing applications to map data in a larger set to a value in a smaller set. For example, a relatively long sequence of bits may be supplied as an input into a mathematical function to generate a shorter sequence of bits that serves as an index into a database table. In general, mathematicians and engineers prefer hashing methodologies that have low computational complexity, are deterministic, yield hash values uniformly distributed across the smaller set, and have other properties useful in computing.
One area of application in which hashing can be particularly useful is load balancing in network switching. In general, a network switch may receive and transmit data packets via multiple ingress and egress links. In many situations, it is permissible to direct a received data packet via more than one egress link to properly route the data packet to its destination. Moreover, network switches sometimes are purposefully aggregated into load-balancing networks to provide more bandwidth between communicating devices or networks. Grouping links together to define wider communication channels is known as link aggregation (LAG). In those situations where multiple links present equally attractive routing choices to a network switch, the routing technique is typically referred to as equal-cost multi-path (ECMP) routing. If, on the other hand, some of the links present non-equal routing choices to the network switch, the routing technique may be referred to as weighed-cost multi-path (WCMP).
To properly balance the distribution of data packets among the multiple equally appropriate links in LAG applications, the network switch may “hash” the data packets into the corresponding links. However, known hashing techniques often produce polarization, or “favoring” of a particular link in a group of suitable links for certain types of packets. Further, when multiple network switches operate as respective hops in a load-balancing network, the same load balancing decision may be made at each hop, thus further polarizing a particular path through the load-balancing network.